<?php

App::uses('CrudController', 'Controller');

class PorCaducarController extends CrudController
{
    public $_model = 'Certification';

    public function admin() {
        $this->request->allowMethod('get');
        $appBosch = new stdClass();
        $this->set('appBosch', $appBosch);
        $this->set('title', __('Certificaciones en entrenamiento'));
        $this->set('description', __('Por caducar'));
    }

    protected function getRecords($param) {
        $userSessionId = $this->Auth->user('id');
        $this->loadModel('UserArea');
        $records = $this->UserArea->getCertificationsInTraining($userSessionId);
        return $records;
    }

    protected function id($model) {
        return $model->id;
    }

    protected function u($model) {
        return array(
            'end' => $model->end,
        );
    }
    
    protected function resultUpdate($id, $result) {
        $this->loadModel('Certification');
        $records = $this->Certification->getByIdWithDetails($id);
        return $records[0];
    }

    protected function c($model) {
        return array();
    }

}
